import { createRouter, createWebHashHistory } from "vue-router";
const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/",
      component: () => import("@/layout/index.vue"),
      redirect: "/css-architecture-mogujie/home",
      children: [
        {
          path: "/css-architecture-mogujie/",
          redirect: "/css-architecture-mogujie/home",
        },
        {
          path: "/css-architecture-mogujie/home",
          component: () => import("@/views/home/index.vue"),
        },
        {
          path: "/css-architecture-mogujie/shop",
          component: () => import("@/views/shop/index.vue"),
        },
        {
          path: "/css-architecture-mogujie/live",
          component: () => import("@/views/live/index.vue"),
        },
        {
          path: "/css-architecture-mogujie/mine",
          component: () => import("@/views/mine/index.vue"),
        },
      ],
    },
    {
      path: "/css-architecture-mogujie/promotion",
      component: () => import("@/layout/promotion.vue"),
      redirect: "/css-architecture-mogujie/fast-buy",
      children: [
        {
          path: "/css-architecture-mogujie/fast-buy",
          component: () => import("@/views/fast-buy/index.vue"),
        },
        {
          path: "/css-architecture-mogujie/sell-short",
          component: () => import("@/views/sell-short/index.vue"),
        },
        {
          path: "/css-architecture-mogujie/my-fast",
          component: () => import("@/views/my-fast/index.vue"),
        },
      ],
    },
    {
      path: "/css-architecture-mogujie/live/detail",
      component: () => import("@/views/live/detail.vue"),
    },
  ],
});

router.beforeEach((to, from, next) => {
  next();
});
export default router;
